package util

import "encoding/hex"

type Encryption interface {
	Write([]byte) (int, error)
	Sum([]byte) []byte
}

func Encrypt(text string, en Encryption) string {
	_, _ = en.Write([]byte(text))
	return hex.EncodeToString(en.Sum(nil))
}
